public class Item {

        // Will add more types, weights, and prices later. The weights and prices correspond to the type of the same index.
        private final String TYPES[] = {"Penicillin", "Hamburger", "Tire"};
        private final double WEIGHTS[] = {2.5, 5, 27};
        private final double PRICES[] = {50, 3.5, 20};

        private String type = new String();
        private double weight = 0.0;
        private double price = 0.0;
        private int quantity = 0;

        public Item(String type, int quantity) {
                this.type = type;
                this.quantity = quantity;

                int typeIndex = 0;
                for (int i = 0; i < TYPES.length; i++) {
                        if (TYPES[i].equalsIgnoreCase(type)) {
                                typeIndex = i;
                        }
                }

                weight = WEIGHTS[typeIndex];
                price = PRICES[typeIndex];
        }

        public String getType() {
                return type;
        }

        public double getWeight() {
                return weight;
        }

        public double getPrice() {
                return price;
        }

        public void setPrice(double price) {
                this.price = price;
        }

        public int getQuantity() {
                return quantity;
        }

        public void setQuantity(int quantity) {
                this.quantity = quantity;
        }

        public int incrementQuantity() {
                quantity++;
                return quantity;
        }

        public int decrementQuantity() {
                quantity--;
                return quantity;
        }
}
